org.prorefactor.core
Class Pstring

java.lang.Object
  extended by org.prorefactor.core.Pstring

public class Pstring
extends java.lang.Object

This class is for working with the text of Proparse's QSTRING nodes. Proparse's QSTRING nodes contain the string literal, including the delimiting quotation marks as well as any string attributes. This class will allow us to easily fetch and work with things like just the text portion, just the attributes portion, check if the delimiting quotes are single-quotes or double-quotes, etc.


Constructor Summary
Pstring(java.lang.String quotedString)
          Constructor - should generally only be constructed by passing in the results of parser.getNodeText()
 
Method Summary
static java.lang.String dequote(java.lang.String orig)
          Strip attributes and quotes, if quoted.
 java.lang.String getAttributes()
          Get the string attributes, including the colon.
 char getQuote()
          Get the character quotation mark.
 java.lang.String getText()
          Same as justText - get the text stripped of quotes and attributes.
static boolean isQuoted(java.lang.String checkMe)
          Convenience method to check if the first character of a String is a quote character.
 boolean isTrans()
          Is this string translatable?
 java.lang.String justText()
          Just the text portion of the node's text - er - you know.
 void setAttributes(java.lang.String attributes)
           
 void setQuote(char quote)
           
 void setText(java.lang.String text)
          Set the text portion - the stuff in between the quotation marks.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pstring

public Pstring(java.lang.String quotedString)
Constructor - should generally only be constructed by passing in the results of parser.getNodeText()

Method Detail

dequote

public static java.lang.String dequote(java.lang.String orig)
Strip attributes and quotes, if quoted.


getAttributes

public java.lang.String getAttributes()
Get the string attributes, including the colon.


getQuote

public char getQuote()
Get the character quotation mark.


getText

public java.lang.String getText()
Same as justText - get the text stripped of quotes and attributes.


isQuoted

public static boolean isQuoted(java.lang.String checkMe)
Convenience method to check if the first character of a String is a quote character.


isTrans

public boolean isTrans()
Is this string translatable?

Returns:
True if translatable

justText

public java.lang.String justText()
Just the text portion of the node's text - er - you know.


setAttributes

public void setAttributes(java.lang.String attributes)

setQuote

public void setQuote(char quote)

setText

public void setText(java.lang.String text)
Set the text portion - the stuff in between the quotation marks.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2008 Joanju Software. All Rights Reserved.