More Atom

This commit is contained in:
jamesagnew 2014-02-27 12:04:19 -05:00
parent bec9a51351
commit 45c9186dee
1 changed files with 7 additions and 10 deletions

View File

@ -55,15 +55,13 @@ class ParserState<T extends IElement> {
public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException {
if ("name".equals(theLocalPart)) {
push(new AtomPrimitiveState(myInstance.getAuthorName()));
}else if ("uri".equals(theLocalPart)) {
} else if ("uri".equals(theLocalPart)) {
push(new AtomPrimitiveState(myInstance.getAuthorUri()));
}else {
} else {
throw new DataFormatException("Unexpected element: " + theLocalPart);
}
}
}
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ParserState.class);
@ -131,7 +129,6 @@ class ParserState<T extends IElement> {
myPrimitive = thePrimitive;
}
@Override
public void endingElement(EndElement theElem) throws DataFormatException {
myPrimitive.setValueAsString(myData);
@ -204,10 +201,8 @@ class ParserState<T extends IElement> {
throw new DataFormatException("Found unexpected element content");
}
}
private static final QName ATOM_LINK_REL_ATTRIBUTE = new QName("rel");
private static final QName ATOM_LINK_HREF_ATTRIBUTE = new QName("href");
@ -232,7 +227,9 @@ class ParserState<T extends IElement> {
@Override
public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException {
if (theLocalPart.equals("title")) {
if ("entry".equals(theLocalPart) && verifyNamespace(XmlParser.ATOM_NS, theNamespaceURI)) {
} else if (theLocalPart.equals("title")) {
push(new AtomPrimitiveState(myInstance.getTitle()));
} else if ("id".equals(theLocalPart)) {
push(new AtomPrimitiveState(myInstance.getId()));
@ -244,8 +241,8 @@ class ParserState<T extends IElement> {
push(new AtomPrimitiveState(myInstance.getUpdated()));
} else if ("author".equals(theLocalPart)) {
push(new AtomAuthorState(myInstance));
}
}
// TODO: handle category and DSig
}